package com.battle.pojo.converter;

import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONArray;

import java.util.ArrayList;
import java.util.List;

/**
 * @author anni.zhu
 * @author anni.zhu@king-v.com
 * Created in 2024/8/28 16:00
 */
public class StringListConverter extends ListObjectConvert<List<String>>{

    @Override
    public List<String> convertToEntityAttribute(String dbData) {
        return StrUtil.isBlankOrUndefined(dbData) ? new ArrayList<>() : JSONArray.parseArray(dbData, String.class);
    }
}
